package com.flurry.android;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;
import com.flurry.android.caching.ObjectData;
import java.util.Vector;
import org.apache.http.NameValuePair;

abstract class dr
{
  protected CacheDBOperations fB = null;

  protected boolean a(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    if (!paramString2.equals(this.fB.getValueByKey(paramString1, paramString3, paramString4)))
    {
      b(paramString3, paramString1, paramString2);
      AppCloudSearch.onMakeSearchNotValidForCollection(paramString4);
      this.fB.updateItem(paramString1, paramString2, paramString3, paramString4);
      return true;
    }
    return false;
  }

  public final String aI()
  {
    this.fB.readAll();
    return "";
  }

  public final void b(ObjectData paramObjectData)
  {
    int i = 0;
    if (i < paramObjectData.getKeyValues().size())
    {
      String str1 = ((NameValuePair)paramObjectData.getKeyValues().get(i)).getName();
      String str2 = ((NameValuePair)paramObjectData.getKeyValues().get(i)).getValue();
      if (paramObjectData.isUser())
        a(str1, str2, paramObjectData.getId(), null);
      while (true)
      {
        i++;
        break;
        a(str1, str2, paramObjectData.getId(), paramObjectData.getCollectionName());
      }
    }
  }

  protected final void b(String paramString1, String paramString2, String paramString3)
  {
    if ((AppCloudUser.getCurrentUser() != null) && (TextUtils.equals(AppCloudUser.getCurrentUser().getId(), paramString1)))
      AppCloudUser.getCurrentUser().set(paramString2, paramString3);
    if (FlurryAppCloud.F() != null)
      r.a(paramString1, paramString2, paramString3);
  }

  public final void c(String paramString1, String paramString2, String paramString3)
  {
    this.fB.c(paramString1, paramString2, paramString3);
  }

  public final boolean c(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    return a(paramString1, paramString2, paramString3, paramString4);
  }

  public final ObjectData getObjectById(String paramString)
  {
    return this.fB.getObjectById(paramString);
  }

  public final boolean isUserObject(String paramString)
  {
    return this.fB.isUserObject(paramString);
  }

  public final ObjectData w(String paramString)
  {
    CacheDBOperations localCacheDBOperations = this.fB;
    Cursor localCursor = localCacheDBOperations.cD.getReadableDatabase().query(localCacheDBOperations.cE, null, "objectsId='" + paramString + "'", null, null, null, "objectsId ASC, julianday(timestamp)");
    ObjectData localObjectData;
    String str1;
    String str2;
    if (localCursor.moveToFirst())
    {
      int i = localCursor.getColumnIndex("primery_key_id");
      int j = localCursor.getColumnIndex("objectsId");
      int k = localCursor.getColumnIndex("collectionName");
      int m = localCursor.getColumnIndex("key");
      int n = localCursor.getColumnIndex("value");
      localObjectData = null;
      do
      {
        int i1 = localCursor.getInt(i);
        str1 = localCursor.getString(j);
        str2 = localCursor.getString(k);
        String str3 = localCursor.getString(m);
        String str4 = localCursor.getString(n);
        if (localObjectData == null)
        {
          if (!TextUtils.isEmpty(str2))
            break;
          localObjectData = new ObjectData(str1);
        }
        localObjectData.addKeyValue(str3, str4);
        localCacheDBOperations.e(i1);
      }
      while (localCursor.moveToNext());
    }
    while (true)
    {
      localCursor.close();
      return localObjectData;
      localObjectData = new ObjectData(str1, str2);
      break;
      localObjectData = null;
    }
  }

  public final boolean x(String paramString)
  {
    return this.fB.contains(paramString);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.flurry.android.dr
 * JD-Core Version:    0.6.2
 */